import http from "@/utils/request"

export default {
	table: {
		import: {
			url: '/gen/table/import',
			name: "导入表",
			post: function (data) {
				return http.post(this.url, data);
			}
		},
		create: {
			url: '/gen/table/create',
			name: "新建表",
			post: function (data) {
				return http.post(this.url, data);
			}
		},
		remove: {
			url: '/gen/table/remove',
			name: "删除表",
			delete: function (data) {
				return http.delete(this.url, data);
			}
		},
		edit: {
			url: '/gen/table/edit',
			name: "编辑表",
			put: function (data) {
				return http.put(this.url, data);
			}
		},
		page: {
			url: '/gen/table/page',
			name: "表分页",
			get: function (params) {
				return http.get(this.url, params);
			}
		},
		detail: {
			url: '/gen/table/',
			name: "表详情",
			get: function (id) {
				return http.get(this.url + id);
			}
		},
		genLocal: {
			url: '/gen/table/genLocal/',
			name: "代码生成",
			post: function (id) {
				return http.post(this.url + id);
			}
		},
		genDownload: {
			url: '/gen/table/genDownload/',
			name: "代码下载",
			downloadFile: function (id) {
				return http.downloadFile(this.url + id, "code.zip");
			}
		},
		pageDbTable: {
			url: '/gen/table/pageDbTable',
			name: "查询数据库表",
			get: function (params) {
				return http.get(this.url, params);
			}
		}
	},
	tableColumn: {
		add: {
			url: '/gen/tableColumn/add',
			name: "新增表字段",
			post: function (data) {
				return http.post(this.url, data);
			}
		},
		remove: {
			url: '/gen/tableColumn/remove',
			name: "删除表字段",
			delete: function (data) {
				return http.delete(this.url, data);
			}
		},
		edit: {
			url: '/gen/tableColumn/edit',
			name: "编辑表字段",
			put: function (data) {
				return http.put(this.url, data);
			}
		},
		page: {
			url: '/gen/tableColumn/page',
			name: "表字段分页",
			get: function (params) {
				return http.get(this.url, params);
			}
		}
	},
	project: {
		add: {
			url: '/gen/project/add',
			name: "新增项目配置",
			post: function (data) {
				return http.post(this.url, data);
			}
		},
		edit: {
			url: '/gen/project/edit',
			name: "编辑项目配置",
			put: function (data) {
				return http.put(this.url, data);
			}
		},
		get: {
			url: '/gen/project/get',
			name: "获取项目配置",
			get: function (params) {
				return http.get(this.url, params);
			}
		}
	},
	columnMap: {
		add: {
			url: '/gen/columnMap/add',
			name: "新增字段映射",
			post: function (data) {
				return http.post(this.url, data);
			}
		},
		remove: {
			url: '/gen/columnMap/remove',
			name: "删除字段映射",
			delete: function (data) {
				return http.delete(this.url, data);
			}
		},
		edit: {
			url: '/gen/columnMap/edit',
			name: "编辑字段映射",
			put: function (data) {
				return http.put(this.url, data);
			}
		},
		page: {
			url: '/gen/columnMap/page',
			name: "字段映射分页",
			get: function (params) {
				return http.get(this.url, params);
			}
		},
		list: {
			url: '/gen/columnMap/list',
			name: "字段映射列表",
			get: function (params) {
				return http.get(this.url, params);
			}
		}
	}
}
